package day5;

import day4.Point;

    public class Circle {
        int r;
        Point center;

        public Circle(){

        }

        public Circle(int r, Point center){
            this.r = r;
            this.center = center;
        }

        public Circle(int r, int x, int y) {
            this(r,new Point(x,y));
        }

            public double area(){

            return ((int)(Math.PI * r * r*100))/100.0;
        }

        //判断一个点是否在圆的内部
        public boolean container(Point p){
            return this.center.distance(p) < r;
        }

        public boolean container(int x, int y){
            return this.container(new Point(x,y));
        }
    }

